home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / grapdrvs / nuldrvs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  2.1 KB  |  74 lines

  1. /*****************************************************************************
  2. *   A NUL device driver. Prints the objects it recieves from server.         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.1, June 1993.  *
  5. *****************************************************************************/
  6.  
  7. #include "irit_sm.h"
  8. #include "iritprsr.h"
  9. #include "allocate.h"
  10. #include "attribut.h"
  11. #include "iritgrap.h"
  12. #include "irit_soc.h"
  13.  
  14. /****************************************************************************
  15. * Simple client - reads from sockets and prints to stdout.            *
  16. ****************************************************************************/
  17. void main(int argc, char **argv)
  18. {
  19.     IPObjectStruct
  20.     *PObjects = NULL;
  21.  
  22.     IGConfigureGlobals("nuldrvs", argc, argv);
  23.     IGProcessCommandMessages(FALSE);
  24.  
  25.     if (IGGlblStandAlone) {
  26.     fprintf(stderr, "NULDrvs has no meaning running stand alone.\n");
  27.     exit(1);
  28.     }
  29.  
  30.     if (!IGGlblDebugObjectsFlag && !IGGlblDebugEchoInputFlag) {
  31.     fprintf(stderr, "NULDrvs is pretty useless with neither -d nor -D.\n");
  32.     exit(1);
  33.     }
  34.  
  35.     SocClientCreateSocket();
  36.  
  37.     while (TRUE) {
  38.     IGReadObjectsFromSocket(IGGlblViewMode, &PObjects);
  39.     if (PObjects != NULL && IP_IS_STR_OBJ(PObjects)) {
  40.         if (strcmp(PObjects -> U.Str, "EXIT") == 0)
  41.         break;
  42.  
  43.         IPFreeObjectList(PObjects);
  44.         PObjects = NULL;
  45.     }
  46.     IritSleep(10);
  47.     }
  48.  
  49.     SocClientCloseSocket();
  50.     exit(0);
  51. }
  52.  
  53. /****************************************************************************
  54. * A call back function that will never be invoked.                *
  55. ****************************************************************************/
  56. int IGHandleState(int State, int Refresh)
  57. {
  58.      return FALSE;
  59. }
  60.  
  61. /*****************************************************************************
  62. * Routine to make some sound.                             *
  63. *****************************************************************************/
  64. void IGIritBeep(void)
  65. {
  66. }
  67.  
  68. /*****************************************************************************
  69. * Routine to create the state menu.                         *
  70. *****************************************************************************/
  71. void IGCreateStateMenu(void)
  72. {
  73. }
  74.